//
//  IndustryNewDetailViewController.m
//  Rail
//
//  Created by hychen on 2018/3/2.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "IndustryNewDetailViewController.h"

@interface IndustryNewDetailViewController ()

@end

@implementation IndustryNewDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSMutableSet *newCacheSet = [[CacheTool sharedTool] objectForKey:Cache_IndustryNew_Scan_Key];
    if (!newCacheSet) {
        newCacheSet = [NSMutableSet set];
    }
        if (self.model) {
            if (![newCacheSet containsObject:self.model.newsid]) {
                [newCacheSet addObject:self.model.newsid];
                [[CacheTool sharedTool] setObject:newCacheSet forKey:Cache_IndustryNew_Scan_Key];
            }
            if (self.model.content_url) {
                self.url = self.model.content_url;
                [self loadUrlString:self.url];
            }
            else {
                //加载Web或Html
                [self.webView loadHTMLString:self.model.content?:@"" baseURL:nil];
                self.webView.scrollView.mj_header = nil;
            }
        }
        else if (self.theNewModel) {
            if (![newCacheSet containsObject:self.theNewModel.newsid]) {
                [newCacheSet addObject:self.theNewModel.newsid];
                [[CacheTool sharedTool] setObject:newCacheSet forKey:Cache_IndustryNew_Scan_Key];
            }
            if (self.theNewModel.content_url) {
                self.url = self.theNewModel.content_url;
                [self loadUrlString:self.url];
            }
            else {
                //加载Web或Html
                [self.webView loadHTMLString:self.theNewModel.content?:@"" baseURL:nil];
                self.webView.scrollView.mj_header = nil;
            }
        }
    
    [self.navigationItem addSimpleTitleView:@"详情"];
//    [self.navigationItem addRightNavItem:self normalImage:ImageNamed_bb(@"app_title_bar_share_n") highlightedImage:ImageNamed_bb(@"app_title_bar_share_p") selector:@selector(clickShare)];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//- (void)clickShare {
//    
//}

@end
